<template>
<!-- 权限列表组件 -->
<div>
    <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item>权限管理</el-breadcrumb-item>
        <el-breadcrumb-item>权限列表</el-breadcrumb-item>
    </el-breadcrumb>
    <el-card>
        <user-table :RightList="RightList"></user-table>
    </el-card>
</div>
</template>
<script>
import userTable from './children/RightsTable'
export default {
  components: {
    userTable
  },
  data () {
    return {
      RightList: []
    }
  },
  created () {
    this.getRightList()
  },
  // 权限列表数据获取
  methods: {
    async getRightList () {
      const { data: res } = await this.$http.get('rights/list')
      if (res.meta.status !== 200) return this.$message.error(res.meta.msg || '权限列表数据获取失败')
      this.RightList = res.data
    }
  }
}
</script>
